//
// Created by gogoqiu on 2021/8/26.
//

#include "SwitchControl.h"
BEGIN_EVENT_TABLE(SwitchControl, wxControl)
    EVT_PAINT(SwitchControl::OnPaint)
END_EVENT_TABLE()

IMPLEMENT_DYNAMIC_CLASS(SwitchControl, wxControl)

/**
 * 时钟设置动画
 * @param event
 */
void SwitchControl::OnPaint( wxPaintEvent& event ){

}

SwitchControl::~SwitchControl(){

}

bool SwitchControl::Create(wxWindow *parent, wxWindowID id,
                           const wxPoint &pos, const wxSize &size, long style,
                           const wxValidator &validator) {
    //m_timer.Bind(wxEVT_TIMER, &MyFrame::OnTimer, this);

    return false;
}

//progressbar
void SwitchControl::OnTimer( wxTimerEvent& event )
{

    event.Skip();
}

/*
// Constructor
vsButtonDrag::vsButtonDrag(wxWindow *parent, wxWindowID id, const wxBitmap& bitmap, const wxString& string,
                           const wxPoint& pos, const wxSize& size, long style,
                           const wxValidator& validator,
                           const wxString& name)
        : wxControl(parent, id, pos, size, style | wxNO_BORDER, validator, name)
        ...
, m_Timer( this, VS_DRAG_TIMER )
{
}


void vsButtonDrag::OnLeftUp(wxMouseEvent &event)
{
    ...
    m_Timer.Start( 10 );
    ...
}

void vsButtonDrag::OnTimer( wxTimerEvent& event )
{
    int X = m_DragWindow->GetPosition().x;
    int Y = m_DragWindow->GetPosition().y;

    X -= xStep; Y -= yStep;

    m_DragWindow->SetPosition( wxPoint( X, Y ) );

    nStep--;

    if( nStep < 0 )
    {
        m_Timer.Stop();
        m_DragWindow->Hide();

        delete m_DragWindow;

        m_DragWindow = NULL;
    }

    event.Skip();
}

*/